<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>个人申请状态</title>
<link rel="stylesheet" href="../public/layui/css/layui.css" media="all">
<script src="../public/layui/layui.js" charset="utf-8"></script>
</head>
<body>
<%if(session.getAttribute("user")==null){ %>
    <script>
		window.top.location.replace("../login.jsp");
	</script>
<%}%>
<div>
	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
		<legend><h2>我的申请</h2></legend>
	</fieldset>
	<table class="layui-hide" id="demo"></table>
	
	<script type="text/javascript">
	layui.use(['table'],function(){
		var table = layui.table;
		
		table.render({
			elem: '#demo'
			    ,height: 500
			    ,url: '../OrdinaryEmployeesServlet?button=5' //数据接口
			    ,page: true //开启分页
			    ,cols: [[ //表头
			      {field: 'applyid', title: '申请编号', width:110, sort: true}
			      ,{field: 'applicant', title: '申请人', width:80}
			      ,{field: 'applytime', title: '申请提交时间', width: 180}
			      ,{field: 'overtime', title: '普通加班时长（单位小时）', width:200} 
			      ,{field: 'weekovertime', title: '周末加班时长（单位小时）', width: 200}
			      ,{field: 'festovertime', title: '节假日加班时长（单位小时）', width: 220}
			      ,{field: 'applydescribe', title: '相关描述', width: 250}
			      ,{field: 'status', title: '审批状态', width:150, templet:'#statusTpl'}
			      ,{field: 'handle', title: '审批人', width: 100}
			      ,{field: 'handletime', title: '审批时间', width: 180}
			    ]]
		})
	})
	</script>
	<script type="text/html" id="statusTpl">
  		{{#  if(d.status == 0){ }}
   	 			<span style="color:#01AAED;">等待审核</span>
  		{{#  } else if(d.status == 1){ }}
    	        <span style="color:#5FB878;">审核通过</span>
  		{{#  } else { }}
				<span style="color:#FF5722;">审核被拒绝</span>
		{{#  } }}
	</script>
</div>
</body>
</html>